<!-- <script setup>
import HelloWorld from './components/HelloWorld.vue'

</script>

<template>
  <div>
    <a href="https://vitejs.dev" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <HelloWorld msg="Vite + Vue" />
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style> -->


<template>
  <div id="app">
    <TUIKit :SDKAppID="SDKAppID" :userID="userID" :userSig="userSig" />
    <TUICallKit class="callkit-container" :allowedMinimized="true" :allowedFullScreen="false" />
  </div>
</template>

<script lang="ts" setup>
import { TUIKit } from './TUIKit';
import { TUICallKit } from '@tencentcloud/call-uikit-vue';
import { setToken, setRecvId } from '@/utils/auth'
import { addFriend } from '@/api'

  const SDKAppID = ref(1600046085)
  const userID = ref('110')
  const userSig = ref('eJyrVgrxCdYrSy1SslIy0jNQ0gHzM1NS80oy0zLBwoaGMOHilOzEgoLMFCUrQzMDAwMTMwMLU4hMakVBZlEqUNzU1NQIKAURLcnMBYmZGxmaG1qaGRtDTclMB5oaHh6ZaF7sWemY4*pekRKSEmbpH1JYEGqRVuCUpB2jX5aTG6OfpJ3oH6PvYulcbKtUCwDpcDDX')

  // setToken('4a4ab883cc6442c0866863de0cc1de99')// 众茶 48542
  // setToken('9efb5fe10bad44e8b5b4cdfd996b4164')//查核 48941
  // setToken('b64a4702e1cf40fe9cf61bd6c14f7f76')//年年 47503

  let token = GetUrlParam('token')
  console.log(6666666666666, token)
  setToken(token)//查核 48941

  let recvId = GetUrlParam('recvId')
  setRecvId(recvId)

  function GetUrlParam(name: string) {
    // 用该属性获取页面 URL 地址从问号 (?) 开始的 URL（查询部分）
    var url = window.location.search;
    // 正则筛选地址栏
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    // 匹配目标参数
    var result = url.substr(1).match(reg);
    //返回参数值
    return result ? decodeURIComponent(result[2]) : null;
  }

  document.title = '众茶国际客服聊天'
  // addFriend({ friendId: '48542' }).then((response: any) => {
  //   console.log('添加好友成功');
  // })
</script>

<style lang="scss">
</style>